package com.liang.bishi.san60;

import java.util.Scanner;

public class Test02 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();
        for (int i = 0; i < t; i++) {
            int n = in.nextInt();
            int x = in.nextInt();
            int[] nums = new int[n];
            for (int j = 0; j < n; j++) {
                nums[i] = in.nextInt();
            }
            System.out.println(getCounts(n, x, nums));
        }
    }

    private static int getCounts(int n, int x, int[] nums) {
        int[] dp = new int[x + 1];
        dp[0] = 1;
        int result = 0;
        for (int num : nums) {
            int[] newDp = new int[x + 1];
            for (int j = 0; j <= x; j++) {
                if (dp[j] > 0) {
                    newDp[j] += dp[j];
                    if (j + num <= x) {
                        newDp[j + num] += dp[j];
                    }
                }
            }
            dp = newDp;
        }
        for (int i = 0; i <= x; i++) {
            result += dp[i];
        }
        return result;
    }


    private static int getCounts2(int n, int x, int[] nums) {
        int totalWays = 0;
        for (int i = 0; i < (1 << n); i++) {
            int sum = 0;
            int count = 0;
            for (int j = 0; j < n; j++) {
                if ((i & (1 << n)) != 0) {
                    sum += nums[j];
                }
            }
            if (count >= (n + 1) / 2 && sum >= x) {
                totalWays++;
            }
        }
        return totalWays;
    }
}
